
package ui.adapter;

import android.content.Context;
import android.graphics.Color;
import android.text.Html;
import android.text.Spanned;
import android.view.View;
import android.widget.TextView;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import Bean.JiFenRecordBean;
import Bean.PresentRecordBean;
import Utils.StringUtil;
import base.BaseViewHolder;
import base.SuperBaseAdapter;
import util.SysUtils;


/**
 * 提现列表适配器
 * Created by chenjian on 19/2/27.
 */
public class JiFenAdapter extends SuperBaseAdapter<JiFenRecordBean.DataBean> {

    List<JiFenRecordBean.DataBean> mData = new ArrayList<>();
    Context mContext;
    int mtype;

    public JiFenAdapter(Context context, List<JiFenRecordBean.DataBean> data,int type) {
        super(context, data);
        mContext = context;
        mData = data;
        mtype = type;
    }

    @Override
    protected void convert(BaseViewHolder holder, final JiFenRecordBean.DataBean item, final int position) {
        TextView time = holder.getView(R.id.lvpr_txt1);
        TextView value = holder.getView(R.id.lvpr_txt2);
        time.setText(SysUtils.sf6.format(new Date(item.getCreateTime())));
        value.setText(item.getIntegral());

        if(mtype==0){
            holder.getView(R.id.jiahaoimg).setVisibility(View.VISIBLE);
            holder.getView(R.id.jianhaoimg).setVisibility(View.GONE);
        }else {
            holder.getView(R.id.jiahaoimg).setVisibility(View.GONE);
            holder.getView(R.id.jianhaoimg).setVisibility(View.VISIBLE);
        }


    }


    @Override
    protected int getItemViewLayoutId(int position, JiFenRecordBean.DataBean item) {
        return R.layout.jifenrecord_list;
    }

}
